Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[staging] python313Packages.pyzmq: disable flaky tests #367255

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

paparodeo
Copy link
Contributor

@paparodeo paparodeo commented Dec 22, 2024

3 tests are marked as flaky and fail periodically on hydra, disable them. Alternatively, adding pytest-rerunfailures package will enable the tests to be rerun (they are marked as rerun=3) but just disable them all together.

before:
collected 364 items / 81 deselected / 1 skipped / 283 selected
after:
collected 364 items / 84 deselected / 1 skipped / 280 selected

https://github.com/pytest-dev/pytest-rerunfailures

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 30, 2024
@@ -63,6 +63,8 @@ buildPythonPackage rec {
rm -r zmq
'';

pytestFlagsArray = [ "-m 'not flaky'" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this will work with structured attributes (#347194); might need pytestFlagsArray+=(-m 'not flaky') in a Bash phase? cc @ShamrockLee

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a pretty common pattern in the python modules. tho I can probably write it as [ "-m" "'not flaky'"] which might be more future compatible ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, that worked got:
collected 364 items / 84 deselected / 1 skipped / 280 selected

which is what it should be when the 3 flaky tests are disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tho when I add __structuredAttrs = true; both revisions have the same result -- 3 flaky tests are disabled so perhaps it just doesn't matter.

Copy link
Contributor

@ShamrockLee ShamrockLee Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#347194 will leave pytestFlagsArray as is and introduce pytestFlags as the new, conforming interface. (The pytestFlags version will be pytestFlags = [ "-m" "not flaky" ];, and will require __structuredAttrs = true to keep the spaced argument from splitting.)

Due to historical reasons, pytestFlagsArray are string-concatenated and Bash-evaluated before appending to the command. Unfortunately, specifying it as a Bash array doesn't prevent such Bash-evaluating behaviour.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it’s fine for now then; migrating off the broken pytestFlagsArray semantics is a task for another time.

@paparodeo paparodeo force-pushed the pyzmq-disable-flaky-tests branch from a37ce89 to a67e93f Compare January 3, 2025 02:04
3 tests are marked as flaky and fail periodically on hydra, disable
them. Alternatively, adding pytest-rerunfailures package will enable the
tests to be rerun (they are marked as `rerun=3`) but just disable them
all together.

before:
collected 364 items / 81 deselected / 1 skipped / 283 selected
after:
collected 364 items / 84 deselected / 1 skipped / 280 selected

https://github.com/pytest-dev/pytest-rerunfailures
https://cache.nixos.org/log/ja0w2jni5qzlgrzp2sjl67rcjzrxxz0r-python3.13-pyzmq-26.2.0.drv
@paparodeo paparodeo force-pushed the pyzmq-disable-flaky-tests branch from a67e93f to be63334 Compare January 3, 2025 02:09
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 3, 2025
@emilazy emilazy merged commit 3369d54 into NixOS:staging Jan 3, 2025
23 of 24 checks passed
@paparodeo paparodeo deleted the pyzmq-disable-flaky-tests branch January 3, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants